#include "Magic.h"

cMagicDescription::cMagicDescription()
{
	this->m_Animation = NULL;
}

cMagicDescription::~cMagicDescription()
{
	if (m_Animation!=NULL)
	{
		delete m_Animation;
		m_Animation = NULL;
	}
}


///////////////////////////////////////////////////////////////////////////////


cMagicHandler::cMagicHandler(void)
{
}

cMagicHandler::~cMagicHandler(void)
{
	vector<cMagicDescription*>::iterator iter = m_Magics.begin();
	for (;iter!=m_Magics.end();iter++)
	{
		delete *iter;
	}
}

cMagicDescription *cMagicHandler::GetMagicDescription(string MagicID)
{
	vector<cMagicDescription*>::iterator iter = m_Magics.begin();
	for (;iter!=m_Magics.end();iter++)
	{
		if ((*iter)->m_MagicID == MagicID)
		{
			return *iter;
		}
	}
	return NULL;
}

BOOL cMagicHandler::PushMagic(cMagicDescription *magic)
{
	m_Magics.push_back(magic);

	return TRUE;
}

BOOL cMagicHandler::RemoveMagic(string MagicID)
{
	return TRUE;
}